/*
 * A class that represents attributes of each BoardSquare for the game Sorry.
 * @Author: Jeffrey Hatch
 * @Date: 11/12/11
 */
public class BoardSquare 
{
        private int colorPanel;
        private int pawnColor;
        private int safeColor;
        private int startSlide;
        private boolean isSZEntrance;
        
        /*
         * Constructor that creates a BoardSquare object with its attributes set.
         * Input colorPanel: sets the colorPanel so that we know which color the side of the board is.
         * Input startSlide: sets whether the BoardSquare is a start of a slide and how many squares it will slide down.
         * Input safetyZone: sets the switch that will notify if an occupying pawn is in a safety zone.
         */
        public BoardSquare(boolean safetyZone, int colorPanel, int startSlide)
        {
    //No pawn so I'm setting color to -1
                setColorPawn(-1);
                setSafeColor(-1);
                this.colorPanel = colorPanel;
                this.startSlide = startSlide;
        }
        
        /*
         * Sets the color panel of the side of the board
         * Input pawnColor: sets the BoardSquare's knowledge of what color of pawn is occupying it.
         */
        public void setColorPawn(int pawnColor)
        {
                this.pawnColor = pawnColor;
        }
        
        public void setSafeColor(int pawnColor)
        {
        	safeColor = pawnColor;
        }
        
   /*
         * Sets the beginning of a slide of the board
         * Input slideStart: sets the BoardSquare's knowledge of if it is the start of the slide.
         */
        public void setSlide(int slideStart)
        {
                this.startSlide = slideStart;
        }
   
        /*
         * Sets the switch that will notify if an occupying pawn is in its safety zone.
         * Input switchSZ: will change the switch of whether occupying pawn is in the safety zone.
         * Return: True if occupying pawn is in the safety zone or False if the occupying pawn is not in the safety zone.
         */
        public void setIsSZEntrance(boolean switchSZ)
        {
                this.isSZEntrance = switchSZ;
        }
        
        /*
         * Gets the color of the side of the board you are located in.
         * Returns: an integer that will represent what color panel that the BoardSquare is located in.
         */
        public int getColorPanel()
        {       
                return colorPanel;
        }
        
        /*
         * Gets the occupying pawn's color
         * Returns: the occupying pawn's color representation in the form of an integer.
         */
        public int getPawnColor()
        {       
                return pawnColor;
        }
        
        public int getSafeColor()
        {
        	return safeColor;
        }
        
        /*
         * Gets whether the BoardSquare is the start of a slide.
         * Returns: An integer representation of the start of the slide that should indicate how 
         *                      many BoardSquares you will slide down. If 0 it indicates that you will not 
         *                      be sliding.
         */
        public int getStartSlide()
        {       
                return startSlide;
        }
        
        /*
         * Gets if the BoardSquare is the start of a Safety Zone.
         * Returns: True if the occupying pawn is in a Safety Zone or not.
         */
        public boolean getIsSZEntrance()
        {       
                return isSZEntrance;
        }
}
